﻿using Md.Api.Entity.DapperModels.MdDB;
using Md.Api.Model.Manage.SysConfig.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.SysConfig;
/// <summary>
/// 分页获取系统配置列表服务
/// </summary>
public class GetSysConfigPageListService : ApiBase<RequestGetSysConfigPageListModel>
{
    /// <summary>
    /// 系统配置仓储
    /// </summary>
    public SysConfigRep sysConfigRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var model = new SysConfigModel();

        model.ConfigName = Parameter.ConfigName;
        model.ConfigKey = Parameter.ConfigKey;
        model.ConfigValue = Parameter.ConfigValue;
        model.ConfigType = Parameter.ConfigType;
        model.CreateBy = Parameter.CreateBy;
        model.UpdateBy = Parameter.UpdateBy;

        var res = sysConfigRep.GetSysConfigPageList(model, Parameter.PageIndex, Parameter.PageSize, Parameter.OrderBy, Parameter.IsDesc);

        Result.Data = res;
    }
}

